package com.hugothauan.cowboyshoot.Rede;

import android.util.Log;

import com.hugothauan.cowboyshoot.CenaDeJogo;
import com.hugothauan.cowboyshoot.MinhasCoisas;

public class Player {

	private static final String TAG = "Player";
	
	private int HP = 100;
	private int critical_chance;
	private int defense;
	private int attack = 20;
	
	public int lastDamage = 0;
	
	private int recarga;
	
	private PlayerState state = PlayerState.None;
	private ShootType shootType = ShootType.None;

	private boolean prepared = true;
	
	public void Send(String msg, boolean isServer)
	{
		if(isServer)
		{
			CenaDeJogo.HandleFromServer(msg);
		}else
		{
			MinhasCoisas.getClient().send(msg);
		}
	}

	public void SendNotification(String msg, boolean isServer)
	{
		if(isServer)
		{
			MinhasCoisas.Show(msg);
		}else
		{
			Send(Server.SERVER_NOTIFICATION + msg, false);
		}
	}
	public void Load(){}
	
	// GETTERS AND SETTERS
	
	public PlayerState getState() {
		return state;
	}

	public void setState(PlayerState state) {
		this.state = state;
	}
	
	public int getCritical_chance() {
		return critical_chance;
	}

	public void setCritical_chance(int critical_chance) {
		this.critical_chance = critical_chance;
	}

	public int getDefense() {
		return defense;
	}

	public void setDefense(int defense) {
		this.defense = defense;
	}

	public int getAttack() {
		return attack;
	}

	public void setAttack(int attack) {
		this.attack = attack;
	}

	public boolean isPrepared() {
		return prepared;
	}

	public void setPrepared(boolean isAble) {
		this.prepared = isAble;
		Log.i(TAG, "Preparado");
	}
	
	public int getHP() {
		return HP;
	}

	public void setHP(int hP) {
		HP = hP;
	}
	public void RemoveHp(int amount){
		this.HP -= amount;
	}

	public int getRecarga() {
		return recarga;
	}
	public void setRecarga(int recarga) {
		this.recarga = recarga;
	}
	public void subtractRecarga(int amount){
		this.recarga -= amount;
	}
	public void AddRecarga(int amount){
		this.recarga += amount;
	}
	
	public ShootType getShootType() {
		return shootType;
	}

	public void setShootType(ShootType shootType) {
		this.shootType = shootType;
	}
	
}

